package com.huang.canal;

import com.alibaba.otter.canal.client.impl.running.ClientRunningListener;
import com.huang.canal.listener.CanalListener;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;

import javax.annotation.Resource;


@EnableFeignClients  //服务调用
@EnableDiscoveryClient
@SpringBootApplication
public class CanalApplication   implements CommandLineRunner {


    @Resource
    private CanalListener canalListener;
    public static void main(String[] args) {
        SpringApplication.run(CanalApplication.class, args);

    }



    @Override
    public void run(String... args) throws Exception {
        canalListener.run();
    }
}
